-
Notifications
You must be signed in to change notification settings - Fork 92
Add script "Insert Table of Contents II (Map of Contents)" #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution! |
insert-moc/insert-moc.json
Outdated
| @@ -0,0 +1,10 @@ | |||
| { | |||
| "name": "Insert Table of Contents II (M.O.C. Map of Contents)", | |||
| "identifier": "insert-table-of-contents-II-map-of-contents", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The identifier needs to match the directory name and file base-names.
insert-moc/insert-moc.json
Outdated
| { | ||
| "name": "Insert Table of Contents II (M.O.C. Map of Contents)", | ||
| "identifier": "insert-table-of-contents-II-map-of-contents", | ||
| "script": "insert-table-of-contents-II-map-of-contents.qml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Please use insert-moc.qml.
| @@ -0,0 +1,10 @@ | |||
| { | |||
| "name": "Insert Table of Contents II (M.O.C. Map of Contents)", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best remove the Insert, just the name is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
And the JSON file needs to be |
- changed identifier to "insert-moc" - changed script to insert-moc.qml - updated the minAppVersion to 25.12.7 - extended the description.
|
I think I have fixed all relevant issues. I might change the format of the table to indentation style such as:
But this will require an additional logic and I don't have the time right now to put effort int making it prettier. |
insert-moc/info.json
Outdated
| "platforms": ["linux", "macos", "windows"], | ||
| "version": "0.0.1", | ||
| "minAppVersion": "25.12.7", | ||
| "description": "This script generates a list of clickable links which map to every single <code>.md</code> note within the active note folder (= "Map of contents (M.O.C.)"). It displays the links in a table format along with the <em>relative filepaths of the files</em>. Furthermore it sorts the links in alphabetical order. \n The difference to the "Table of Contents" script lies in the fact, that the T.O.C script creates links to headings of the same document whereas this M.O.C. script creates references to every single notename in the active note folder.\n <strong>Usage</strong> \n. <ol> <li>Select the highest folder hierachy <strong>(!)</strong>.</li> <li>Create a new note with an arbitrary name in the highest note hierachy (note level).</li><li>Click the M.O.C button in the script menu. Then the script will overwrite all of the current note content and will insert the linkslist.</li> </ol> \n\n <strong>Warning</strong> \n Note that <strong>all of the content</strong> of the selcted note <strong>will be replaced</strong> by the table of contents link list. Therefore it is essential to create a new note and exclusively use this note for the M.O.C list.\n <strong>automatic updates</strong>\n In case you rename a note, the markdown links in the M.O.C will be automatically updated too, as QOwnNotes watches all markdownlinks and checks links for necessary updates. \n However, if <strong>one creates a new note anywhere, the script must be excecuted again</strong>, as it will otherwise not watch for file additions nor will it add a new link to the list.\n Also if you want to move the M.O.C file to a different location, all the links will be updated accordingly thanks to the QOwnNotes logic. \n An M.O.C. can act as a navitational site (especially when all files are exported as static .html pages) and provide an overview of all available notes. The idea is strongly influenced by the Obsidian plugin 'Waypoint' see <a href="https://github.com/IdreesInc/Waypoint">Waypoint Obsidian</a>. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not valid JSON ("description").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best use an online JSON validator to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the mess with the .json file. Should be fixed. I learned something from it. As I will hopefully soon post another link converting script, I won't step into that trap again. Thanks for the review and your quick replies!
- Removed
"and replaced it with'to give the .json a correct form. - I did not delete the
"Insert", as in the very similar "Table of Contents" script "name" descriptor is called:- "Insert Table of Contents (TOC)"
- Mine: "Insert Table of Contents II (M.O.C. Map of contents)"
If you really want me to I will will remove the name. As a user I just think it is convenient that those 2 scripts are just beneth each other in the script repository menu in QN.
- Removed `"` and replaced it with `'`to give the .json a correct form. - I did not delete the `"Insert"`, as in the very similar "Table of Contents" script "name" descriptor is called: - "Insert Table of Contents (TOC)" - Mine: "Insert Table of Contents II (M.O.C. Map of contents)" If you really want me to I will will remove the name. As a user I just think it is convenient that those 2 scripts are just beneth each other in the script repository menu in QN.
Hello!
This is my first github contribution ever :-).
script content
This script generates a list of clickable links which map to every single
.mdnote within the active note folder (= "Map of contents (M.O.C.)"). It displays the links in a table format along with the relative filepaths of the files. Furthermore it sorts the links in alphabetical order.The difference to the "Table of Contents" script lies in the fact, that the T.O.C script creates links to headings of the same document whereas this M.O.C. script creates references to every single notename in the active note folder.
Usage
Warning
Note that all of the content of the selcted note will be replaced by the table of contents link list. Therefore it is essential to create a new note and exclusive use this note for the M.O.C list.
automatic updates
In case you rename a note, the markdown links in the M.O.C will be automatically updated too, as QOwnNotes watches all markdownlinks and checks links for necessary updates.
However, if one creates a new note anywhere, the script must be excecuted again, as it will otherwise not watch for file additions nor will it add a new link to the list.
Also if you want to move the M.O.C file to a different location, all the links will be updated accordingly thanks to the QOwnNotes logic.